package priv.abadstring.study.elasticsearch.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(
    // 索引名
    indexName = "haoke",
    // 文档类型
    type = "user",
    // 分片数
    shards = 6,
    // 副本数
    replicas = 1
)
// 不创建索引
// @Document( indexName = "haoke", type = "user", createIndex = false)
public class User {
    @Id
    private Long id;
    @Field(store = true)
    private String name;
    @Field
    private Integer age;
    @Field
    private String hobby;
}
